package com.cc.v1;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.Transactional;

/**
 * @title: MainConfig
 * @author: lbj
 * @date: 2022/5/9 9:24 上午
 * @description: TODO 类描述
 */

@Configuration
@ComponentScan
@Import({UserImport.class})
public class MainConfig {

    @Bean
    public User userBean() {
        final User user = new User();
        user.setName("@Bean");
        return user;
    }

    @Bean
    public User userBean2() {
        final User user = new User();
        user.setName("@userBean2");

        System.out.println(userBean());
        System.out.println(userBean());
        System.out.println(userBean());
        return user;
    }

}
